package com.leandro.CalendarioDeCompromissos;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class TelaInicial extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tela_inicial);
        
        View btnRegistro = (Button) findViewById(R.id.btnRegistrar);
        btnRegistro.setOnClickListener(new View.OnClickListener(){
        	
        	@Override
        	public void onClick(View v){
        		
        		try{
        			Intent i = new Intent(TelaInicial.this, TelaRegistro.class);
        			startActivity(i);
        		} catch (Exception e) {
        			Log.e("Erro", null);
        		}
        	}
        	
        	
        });
        
        View btnConsulta = (Button) findViewById(R.id.btnConsultar);
        btnConsulta.setOnClickListener(new View.OnClickListener(){
        	
        	@Override
        	public void onClick(View v){
        		
        		try{
        			Intent i = new Intent(TelaInicial.this, TelaConsulta.class);
        			startActivity(i);
        		} catch (Exception e) {
        			Log.e("Erro", null);
        		}
        	}
        	
        	
        });
        
        
        View btnSair = (Button) findViewById(R.id.btnSair);
        btnSair.setOnClickListener(new View.OnClickListener(){
        	
        	@Override
        	public void onClick(View v){
        		
        			finish();
        		
        	}
        	
        	
        });
        
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.tela_inicial, menu);
        return true;
    }
    
}
